package com.histone.lib_download.downloader;

import java.io.Serializable;

/**
 * @author robin
 * @version v1.0 [2020/6/11]
 * 文件信息（下载路径，本地路径，文件基本信息）
 */
public class FileInfo implements Serializable {
    //文件md5值，检验文件的唯一性
    public String fileMD5;
    //下载地址
    public String downloadUrl;
    //下载文件名
    public String fileName;
    //本地路径
    public String localFilePath;
    //文件长度
    public long fileLength;
    //完成长度
    public long finishLength;


    public FileInfo() {
    }


    public FileInfo(String downloadUrl, String localFilePath) {
        this.downloadUrl = downloadUrl;
        this.localFilePath = localFilePath;
    }

    public FileInfo(String downloadUrl, String localFilePath, String fileName, long fileLength, long finishLength) {
        this.downloadUrl = downloadUrl;
        this.localFilePath = localFilePath;
        this.fileName = fileName;
        this.fileLength = fileLength;
        this.finishLength = finishLength;
    }

    @Override
    public String toString() {
        return "FileInfo{" +
                "fileMD5='" + fileMD5 + '\'' +
                ", downloadUrl='" + downloadUrl + '\'' +
                ", fileName='" + fileName + '\'' +
                ", localFilePath='" + localFilePath + '\'' +
                ", fileLength=" + fileLength +
                ", finishLength=" + finishLength +
                '}';
    }
}
